package DB.Usuario;

public abstract class UsuariosTable {

    private static final String INT_TYPE = " INT";
    private static final String TEXT_TYPE = " TEXT";
    private static final String COMMA_SEP = ", ";
    private static final String NOT_NULL = " NOT NULL ";
    
    public static final String TABLE_NAME = "usuarios";
    
    public static final String COLUMN_ID = "id";
    public static final String COLUMN_NOME = "nome";
    public static final String COLUMN_USERNAME = "username";
    public static final String COLUMN_PASSWORD = "password";
    public static final String COLUMN_OPERADOR = "operador";
    public static final String COLUMN_CPF = "cpf";
    public static final String COLUMN_EMAIL = "email";
    public static final String COLUMN_DATANASCIMENTO = "dataNascimento";
    public static final String COLUMN_NOMECRACHA = "nomeCracha";
    public static final String COLUMN_SEXO = "sexo";
    public static final String COLUMN_ENDERECO = "endereco";
    public static final String COLUMN_CIDADE = "cidade";
    public static final String COLUMN_ESTADO = "estado";
    public static final String COLUMN_PAIS = "pais";
    public static final String COLUMN_CEP = "cep";
    public static final String COLUMN_TELEFONE = "telefone";
    public static final String COLUMN_CELULAR = "celular";
    
    public static final String[] allColumns = { COLUMN_ID, COLUMN_NOME, COLUMN_USERNAME, COLUMN_PASSWORD, COLUMN_OPERADOR, COLUMN_CPF };
    
    public static final String TABLE_CREATE =
            "CREATE TABLE IF NOT EXISTS " + TABLE_NAME + "("
            + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT" + NOT_NULL + COMMA_SEP
            + COLUMN_NOME + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_USERNAME + TEXT_TYPE + NOT_NULL + " CONSTRAINT 'username_unique' UNIQUE ON CONFLICT ROLLBACK " + COMMA_SEP
            + COLUMN_PASSWORD + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_OPERADOR + INT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_CPF + TEXT_TYPE + COMMA_SEP
            + COLUMN_EMAIL + TEXT_TYPE + COMMA_SEP
            + COLUMN_DATANASCIMENTO + TEXT_TYPE + COMMA_SEP
            + COLUMN_NOMECRACHA + TEXT_TYPE + COMMA_SEP
            + COLUMN_SEXO + TEXT_TYPE + COMMA_SEP
            + COLUMN_ENDERECO + TEXT_TYPE + COMMA_SEP
            + COLUMN_CIDADE + TEXT_TYPE + COMMA_SEP
            + COLUMN_ESTADO + TEXT_TYPE + COMMA_SEP
            + COLUMN_PAIS + TEXT_TYPE + COMMA_SEP
            + COLUMN_CEP + TEXT_TYPE + COMMA_SEP
            + COLUMN_TELEFONE + TEXT_TYPE + COMMA_SEP
            + COLUMN_CELULAR + TEXT_TYPE + ");";

    public static final String DELETE_ALL = "DELETE FROM " + TABLE_NAME;
}
